import { queryAdminLog } from '@/services/auditLog/adminLog';

export default {
  namespace: 'adminLog',

  state: {
    // 列表数据
    data: {
      dataList: [],
      pageNum: 0,
      pageSize: 0,
      totalCount: 0,
    },

    queryForm: {},
  },

  effects: {
    *queryList({ payload }, { call, put }) {
      const response = yield call(queryAdminLog, payload);
      yield put({
        type: 'save',
        payload: response.data || {
          dataList: [],
          pageNum: 0,
          pageSize: 0,
          totalCount: 0,
        },
      });
    },
  },

  reducers: {
    save(state, action) {
      return {
        ...state,
        data: action.payload,
      };
    },
  },
};
